using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ConversionTools._KML
{
    /// <summary>
    /// <para>Layer To KML</para>
    /// <para>Converts a feature or raster layer  into a KML file containing a translation of Esri geometries and symbology. This file is compressed using ZIP compression, has a .kmz extension, and can be read by any KML client including ArcGIS Earth, ArcGlobe, and Google Earth.</para>
    /// <para>将要素或栅格图层转换为包含 Esri 几何和符号系统转换的 KML 文件。此文件使用 ZIP 压缩压缩，扩展名为 .kmz，可由任何 KML 客户端读取，包括 ArcGIS Earth、ArcGlobe 和 Google Earth。</para>
    /// </summary>    
    [DisplayName("Layer To KML")]
    public class LayerToKML : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public LayerToKML()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_layer">
        /// <para>Layer</para>
        /// <para>The feature or raster layer or layer file (.lyrx) to be converted to KML.</para>
        /// <para>要转换为 KML 的要素或栅格图层或图层文件 （.lyrx）。</para>
        /// </param>
        /// <param name="_out_kmz_file">
        /// <para>Output File</para>
        /// <para>The output KML file. This file is compressed and has a .kmz extension. It can be read by any KML client including ArcGIS Earth, ArcGlobe, and Google Earth.</para>
        /// <para>输出 KML 文件。此文件经过压缩，扩展名为 .kmz。任何 KML 客户端（包括 ArcGIS Earth、ArcGlobe 和 Google Earth）都可以读取它。</para>
        /// </param>
        public LayerToKML(object _layer, object _out_kmz_file)
        {
            this._layer = _layer;
            this._out_kmz_file = _out_kmz_file;
        }
        public override string ToolboxName => "Conversion Tools";

        public override string ToolName => "Layer To KML";

        public override string CallName => "conversion.LayerToKML";

        public override List<string> AcceptEnvironments => ["extent", "maintainAttachments", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_layer, _out_kmz_file, _layer_output_scale, _is_composite.GetGPValue(), _boundary_box_extent, _image_size, _dpi_of_client, _ignore_zvalue.GetGPValue()];

        /// <summary>
        /// <para>Layer</para>
        /// <para>The feature or raster layer or layer file (.lyrx) to be converted to KML.</para>
        /// <para>要转换为 KML 的要素或栅格图层或图层文件 （.lyrx）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _layer { get; set; }


        /// <summary>
        /// <para>Output File</para>
        /// <para>The output KML file. This file is compressed and has a .kmz extension. It can be read by any KML client including ArcGIS Earth, ArcGlobe, and Google Earth.</para>
        /// <para>输出 KML 文件。此文件经过压缩，扩展名为 .kmz。任何 KML 客户端（包括 ArcGIS Earth、ArcGlobe 和 Google Earth）都可以读取它。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output File")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_kmz_file { get; set; }


        /// <summary>
        /// <para>Layer Output Scale</para>
        /// <para>For raster layers, a value of 0 can be used to create one untiled output image. If a value greater than or equal to 1 is used, it will determine the output resolution of the raster. This parameter has no effect on layers that are not raster layers.</para>
        /// <para>对于栅格图层，值 0 可用于创建一个未平铺的输出影像。如果使用大于或等于 1 的值，则将确定栅格的输出分辨率。此参数对非栅格图层的图层没有影响。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Layer Output Scale")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _layer_output_scale { get; set; } = 0;


        /// <summary>
        /// <para>Return single composite image</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the output will be a single composite image. If your layer is a raster, you can choose either option for this parameter without any visual difference.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The output KML file will be a single composite image representing the raster or vector features in the source layer. The raster is draped over the terrain as a KML GroundOverlay. Use this option to reduce the size of the output KMZ file. When this option is used, individual features and layers in the KML will not be selectable.</bullet_item><para/>
        ///     <bullet_item>Unchecked—If your layer has vector features, they will be preserved as KML vectors.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输出是否为单个合成图像。如果图层是栅格，则可以为此参数选择任一选项，而不会产生任何视觉差异。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 输出 KML 文件将为表示源图层中栅格或矢量要素的单个合成影像。栅格将作为 KML GroundOverlay 覆盖在地形上。使用此选项可减小输出 KMZ 文件的大小。使用此选项时，KML 中的单个要素和图层将不可选择。</bullet_item><para/>
        ///     <bullet_item>未选中 - 如果图层具有矢量要素，则这些要素将保留为 KML 矢量。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Return single composite image")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _is_composite_value _is_composite { get; set; } = _is_composite_value._false;

        public enum _is_composite_value
        {
            /// <summary>
            /// <para>COMPOSITE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("COMPOSITE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_COMPOSITE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_COMPOSITE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Extent to Export</para>
        /// <para><xdoc>
        ///   <para>The geographic extent of the area to be exported. Either define the extent box (in the WGS84 coordinate system) or choose a layer or dataset that defines an extent.</para>
        ///   <bulletList>
        ///     <bullet_item>Default—The extent will be based on the maximum extent of all participating inputs. This is the default.</bullet_item><para/>
        ///     <bullet_item>Current Display Extent—The extent is equal to the data frame or visible display. The option is not available when there is no active map.</bullet_item><para/>
        ///     <bullet_item>As Specified Below—The extent will be based on the minimum and maximum extent values specified.</bullet_item><para/>
        ///     <bullet_item>Browse—The extent will be based on an existing dataset.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要出口的区域的地理范围。定义范围框（在 WGS84 坐标系中）或选择用于定义范围的图层或数据集。</para>
        ///   <bulletList>
        ///     <bullet_item>默认值 - 范围将基于所有参与输入的最大范围。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>当前显示范围 - 范围等于数据框或可见显示。当没有活动地图时，该选项不可用。</bullet_item><para/>
        ///     <bullet_item>如下所述 - 范围将基于指定的最小和最大范围值。</bullet_item><para/>
        ///     <bullet_item>浏览 - 范围将基于现有数据集。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Extent to Export")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _boundary_box_extent { get; set; } = null;


        /// <summary>
        /// <para>Size of returned image (pixels)</para>
        /// <para>The size of the tiles for raster layers if the Layer Output Scale parameter value is set to a value greater than or equal to 1. This parameter has no effect on layers that are not raster layers.</para>
        /// <para>如果图层输出比例参数值设置为大于或等于 1 的值，则栅格图层的切片大小。此参数对非栅格图层的图层没有影响。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Size of returned image (pixels)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _image_size { get; set; } = 1024;


        /// <summary>
        /// <para>DPI of output image</para>
        /// <para><xdoc>
        ///   <para>The device resolution for KML output when the Return single composite image parameter is checked. This parameter is used with the Size of returned image (pixels) parameter to control output image resolution.</para>
        ///   <para>This parameter does not provide the ability to resample source rasters. Any input rasters will have a snapshot taken and included in the KML output as a simple .png image.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>选中返回单个合成影像参数时 KML 输出的设备分辨率。此参数与返回图像的大小（像素）参数一起使用，以控制输出图像分辨率。</para>
        ///   <para>此参数不提供对源栅格进行重采样的功能。任何输入栅格都将拍摄快照，并将其作为简单的.png影像包含在 KML 输出中。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("DPI of output image")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _dpi_of_client { get; set; } = 96;


        /// <summary>
        /// <para>Clamped features to ground</para>
        /// <para><xdoc>
        ///   <para>Specifies whether to override the z-values of the input features.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The z-values of the features will be overridden and draped over the terrain. This setting is used for features that do not have z-values. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The z-values of the features will be respected. The features will be drawn inside KML clients relative to sea level.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否覆盖输入要素的 z 值。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 要素的 z 值将被覆盖并叠加在地形上。此设置用于没有 z 值的要素。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中—将遵循要素的 z 值。这些要素将在 KML 客户端中绘制，并据海平面绘制。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Clamped features to ground")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _ignore_zvalue_value _ignore_zvalue { get; set; } = _ignore_zvalue_value._true;

        public enum _ignore_zvalue_value
        {
            /// <summary>
            /// <para>CLAMPED_TO_GROUND</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("CLAMPED_TO_GROUND")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>ABSOLUTE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ABSOLUTE")]
            [GPEnumValue("false")]
            _false,

        }

        public LayerToKML SetEnv(object extent = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(extent: extent, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}